using System;
using System.Data;

using Geekees.App.Cashbook.Lib;
using Geekees.App.Cashbook.Lib.Entity;
using Geekees.App.Cashbook.Lib.DAL;
using Geekees.App.Cashbook.Lib.Helper;

namespace Geekees.App.Cashbook.Lib.BLL
{
	/// <summary>
	/// Summary description for BLCashItem.
	/// </summary>
	public class BLCashItem
	{
		public BLCashItem()
		{
			
		}

		public static int AddCashItem( float amount, string detail, int categoryId, DateTime createDate, string tag, CashItemType type )
		{
			User u = LoginManager.GetCurrentUser();
			return DACashItem.AddCashItem( u.Id, amount, detail, categoryId, createDate, tag, type, DateTime.Now );
		}

		public static DataTable GetAllCashItem( )
		{
			User u = LoginManager.GetCurrentUser();
			return DACashItem.GetAllCashItem( u.Id );
		}

		public static DataTable SearchCashItem( DateTime fromDate, DateTime toDate, int classificationId, int categoryId, CashItemType type, OrderByType order )
		{
			User u = LoginManager.GetCurrentUser();
			return DACashItem.SearchCashItem( u.Id, fromDate, toDate, classificationId, categoryId, type, order );
		}
		public static bool DeleteCashItem( int itemId )
		{
			User u = LoginManager.GetCurrentUser();
			return DACashItem.DeleteCashItem( itemId, u.Id );
		}
	}
}
